package com.jiangyg.mall.db.hibernate;

import com.jiangyg.mall.db.hibernate.type.CharacterType;
import org.hibernate.boot.model.TypeContributions;
import org.hibernate.service.ServiceRegistry;

/**
 * 类描述：MySQL自定义方言
 * <p>
 * 解决数据库字段char(1)为空时，报错string index out of range: 0的问题
 * 
 * @author jiangyg
 * @date 2021-03-12
 * @version 4.0
 */
public class CustomMySQLDialect extends org.hibernate.dialect.MySQLDialect {

	@Override
	public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
		typeContributions.contributeType(CharacterType.INSTANCE);
	}

}
